package leetcode.day_2020_2021_1_25_2021_1_31;

/**
 * 9. 回文数
 * https://leetcode-cn.com/problems/palindrome-number/
 */
public class LeetCode0009 {
    public static void main(String[] args) {
        System.out.println(isPalindrome(123321));
    }

    public static boolean isPalindrome(int x) {
        if (x < 0) return false;
        int demo = x;
        int x2 = 0;
        while (demo != 0) {
            x2 = x2*10 + demo%10;
            demo = demo/10;
        }
        return x2==x ? true : false;
    }
}
